﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Deflection
{
    public enum MenuItems
    {
        OnePlayer,
        TwoPlayers,
        Exit,
        Continue
    }

    class StartScreen : Screen
    {


        public StartScreen() : base()
        {
            Items = new List<MenuItem>();
            Items.Add(new MenuItem("1 Player", new Vector2(GameParameters.SCREEN_SIZE.X / 2, 200), 0));
            Items[0].Selected += new MenuItem.OnSelectEventHandler(MenuItemSelected);

            Items.Add(new MenuItem("2 Players", new Vector2(GameParameters.SCREEN_SIZE.X / 2, 300), 1));
            Items[1].Selected += new MenuItem.OnSelectEventHandler(MenuItemSelected);

            Items.Add(new MenuItem("Exit", new Vector2(GameParameters.SCREEN_SIZE.X / 2, 400), 2));
            Items[2].Selected += new MenuItem.OnSelectEventHandler(MenuItemSelected);

        }

        public override void MenuItemSelected(int index)
        {
            switch (index)
            {
                case 0:
                    Console.WriteLine("Start game with 1 player");
                    StartGame.Play();
                    OnSelection(MenuItems.OnePlayer);                    
                    break;
                case 1:
                    Console.WriteLine("Start game with 2 player");
                    StartGame.Play();
                    OnSelection(MenuItems.TwoPlayers);
                    break;
                case 2:
                    Console.WriteLine("Exit game");
                    MenuItemSelect.Play();
                    OnSelection(MenuItems.Exit);
                    break;
            }
        }

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            base.Draw(gameTime, spriteBatch);
        }
    }
}
